package com.examiner.service;

import com.examiner.bean.CommonPerson;
import com.examiner.page.QueryInfo;

import java.util.List;

public interface CommonPersonService {
    /**
     * 检测该用户名是否存在
     * @param commonPersonUserName
     * @return
     */
    CommonPerson hasUserName(String commonPersonUserName);

    /**
     * 根据用户名查信息列表
     * @param
     * @return
     */
    List<CommonPerson> findByUserName(QueryInfo queryInfo);

    /**
     * 添加一般用户
     * @param commonPerson
     */
    CommonPerson addCommonPerson(CommonPerson commonPerson);

    /**
     * 物理移出用户
     * @param commonPersonId
     * @return
     */
    Boolean removeCommonPerson(Integer commonPersonId);

    /**
     * 判断当前ID是否存在
     * @param commonPersonId
     * @return
     */
    Boolean existsById(Integer commonPersonId);

    /**
     * 动态删除
     * @param commonPersonId
     * @param state
     */
    void changeCommonPersonState(Integer commonPersonId, Boolean state);

    /**
     * 修改用户信息
     * @param commonPerson
     */
    CommonPerson changeCommonPersonInfo(CommonPerson commonPerson);

    /**
     * 根据id查询信息
     * @param commonPersonId
     * @return
     */
    CommonPerson findById(Integer commonPersonId);


    Boolean updateManagerPassword(Integer id, String encodePsw);

    List<CommonPerson> getPersonList(String superior);

    List<Object> getAllPersonList(String superior) throws Exception;

    void changeAllState() throws Exception;

    void changeExaminer(CommonPerson commonPerson) throws Exception;

    List<CommonPerson> findBySidAndStype(Integer id, String 部门);
}
